package com.xuzimian.global.demo.spring.security.oauth2.resource.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.HashMap;
import java.util.Map;

@RestController
public class UserController {

    @RequestMapping("/user")
        public Map<String, Object> user(Principal puser) {

        Map<String, Object> userinfo = new HashMap<>();
        userinfo.put("id", "123");
        userinfo.put("name",puser.getName());
        userinfo.put("email", "516654313@qq.com");
        userinfo.put("department","董事会");
        userinfo.put("createdate", "2019-07-14");
        return userinfo;
    }
}
